from django.urls import converters


class UsernameConverter:
    regex = '[0-0a-zA-Z]{5,20}'

    def to_python(self, value):
        return str(value)

    def to_url(self, value):
        return str(value)

